<style>
	.registerbox{
		  width: 370px;
		  padding-top: 26px;
		  background-color: #fff;
		  border-radius: 5px;
		  box-shadow: 0 3px 3px rgba(0,0,0,.4);
		  background: #fff;
		  display: none;
	}
	.registerbox input._input{
		  width: 306px;
		  height: 28px;
		  border: 1px solid #d8d8d8;
		  border-radius: 4px;
		  font-size: 14px;
		  color: #666;
		  line-height: 28px;
		  padding: 6px 0 6px 12px;
		  box-shadow: 0 0 5px #fff;
		  outline: none;
		  transition: box-shadow 0.25s linear 0s;
		  -webkit-transition: box-shadow 0.25s linear 0s;
	}
	.registerbox input._input:focus{
		border:1px solid #ffa200; box-shadow:0 0 5px #ffa200; outline:none; transition:box-shadow 0.25s linear 0s; -webkit-transition:box-shadow 0.25s linear 0s;
	}
	.registerbox .form-link{
		  clear: both;
		  width: 320px;
		  margin: 0 auto;
		  padding: 8px 0 0;
		  text-align: right;
	}
	.registerbox ._forget{
	}
	.registerbox .submit-btn {
  		width: 320px;
  		margin: 0 auto;
  		padding: 12px 0 0;
	}
	.registerbox .submit-btn button{
		  width: 320px;
		  height: 42px;
		  border: none;
		  background-color: #ffa800;
		  border-radius: 5px;
		  text-align: center;
		  line-height: 40px;
		  color: #fff;
		  font-size: 18px;
		  font-weight: bold;
		  cursor: pointer;
	}
	.registerbox .form-field {
		  clear: both;
		  width: 320px;
		  margin: 0 auto;
		  padding-top: 10px;
	}
	.registerbox p{
		  padding: 15px 0 20px 0px;
		  font-size: 12px;
		  color: #999;
		  border-top: 1px solid #ebebeb;
		  display: block;
		  text-align: center;
	}
	.registerbox ._input.captcha{
		width: 186px;
		margin-left:30px;	
			/*float: right;*/
	}
	.registerbox .fl{
		cursor: pointer;
		width: 90px;
		height: 40px;
	}
</style>
<style>
	body .layui-layer-close{
		display: block !important;
	}
</style>
<?php

	function getIpAddress(){  
	  $ipContent  = file_get_contents("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js");  
	  $jsonData = explode("=",$ipContent);   
	  $jsonAddress = substr($jsonData[1], 0, -1);  
	  return $jsonAddress;  
	}  
	$area_id = null;
	$ip_info=json_decode(getIpAddress());
	$ip_info = (array)$ip_info;
	if(!empty($ip_info['city'])){
		$info =  Model()->query("select * from ra_area where area_name like '$ip_info[city]%' order by area_deep asc");
		if(isset($info[0])){
			$area_id = $info[0]['area_id'];
		}
	}
?>
<div class='registerbox'>
	<form id='loginForm' action='/shop/index.php?act=login&op=usersave' method='post'>
		<input type='hidden' name='redirect' />
		<input type='hidden' name='formhash' value='PRyP2PVJyRUtmR4q0SCzK35Y4R8KCb0'>
		<div class="form-field">
			<input type="text" class='_input' name='user_name' autocomplete='off' placeholder='请输入您的用户名'>
        </div>
		<div class="form-field">
			<input type="password" class='_input' name='password' placeholder='请设置您的密码'>
        </div>
        <div class="form-field">
			<input type="password" class='_input' name='password_confirm' placeholder='请确认您的密码'>
        </div>
        <div class="form-field">
			<input type="text" class='_input' name='email' autocomplete='off' placeholder='请输入您的邮箱'>
        </div>
        <?php if(C('captcha_status_register') == '1') { ?>
        <div class="form-field">
			<input type="text" id="captcha" name="captcha" class="_input captcha" maxlength="4" size="10"placeholder='请输入验证码' />
            <img src="index.php?act=seccode&op=makecode&nchash=<?php echo getNchash();?>" title="" name="codeimage" border="0" id="codeimage" class="fl"  onclick="javascript:document.getElementById('codeimage').src='index.php?act=seccode&op=makecode&nchash=<?php echo getNchash();?>&t=' + Math.random();"/>
        </div>
        <?php }?>
        <div class="form-field">
			<input type="text" class='_input' name='proxy' readonly autocomplete='off' placeholder='代理商名' style='width: 190px;'>
			<input type='hidden' name='proxy_id'/>
			<input type='hidden' name='contact'/>
			<input type='hidden' name='msg'/>
			<style>
				.choose_proxy{
					display: inline-block;
					*display: inline;
					line-height: 35px;
					background: #f60;
					color: #fff;
					font-size: 14px;
					padding: 0 10px;
					text-decoration: none;
					border-radius: 5px;
					float: right;
					margin-top: 3px;
					margin-right: 2px;
				}
				.choose_proxy:hover{
					text-decoration: none;
					color: #fff;
					background: #f90;

				}
			</style>
			<a href="javascript:;" class='choose_proxy'>选择代理商</a>
			<script>

				$('.choose_proxy').click(function(){
					layer.closeAll();
					layer.open({
		                type: 2,
		                area : ['800px','680px'],
		                skin: 'layui-layer-rim',
		                title : false,
		                scrollbar  : false,
		                content: '/shop/index.php?act=seccode&op=proxy_list&area=<?php echo $area_id?>&notsave=1' ,//iframe的url
		                success : function(){
		                },
		                cancel : function(){
		                	openRegisterWindow();
		                	setTimeout(function(){
		                		// console.log(proxy_info)
		                		$('[name=proxy]').val(proxy_info.proxy_name)
		                		$('[name=proxy_id]').val(proxy_info.proxy_id);
		                	});
		                }
             	 	}); 
					
				});
			</script>
			<p style='padding:3px 0'>建议选择你附近的代理商，确保您能得到及时有效的服务</p>
        </div>
		<div class='form-link'>
			<a href="" class='_forget'>忘记密码</a>
		</div>
		<div class="submit-btn">
            <button type='submit'>注 册</button>
        </div>		
		<p>
			已有账号？<a href="index.php?act=login">马上登录</a>
		</p>
	</form>
</div>

<script>
	$(function(){
		
	})
</script>

